﻿using System;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
using Sautom.ClientComunication;
using Sautom.Modules.Client.ViewModels;
using Sautom.Modules.Client.Views;

namespace Sautom.Modules.Client
{
    public class ModuleInit : IModule
    {
        private readonly IUnityContainer _container;
        private readonly IRegionManager _regionManager;

        public ModuleInit(IUnityContainer container, IRegionManager regionManager)
        {
            _container = container;
            _regionManager = regionManager;
        }

        #region IModule Members

        public void Initialize()
        {
            _container.RegisterType<Object, ClientIndex>(PathProvider.ClientIndex);
            _container.RegisterType<Object, ClientDetails>(PathProvider.ClientDetails);
            _container.RegisterType<Object, ClientEdit>(PathProvider.ClientEdit);
            _container.RegisterType<Object, ModuleTaskButton>(PathProvider.ClientTaskButton);
            _container.RegisterType<Object, ClientAddNewOrder>(PathProvider.ClientAddNewOrder);
            _container.RegisterType<Object, AirlineTicketView>(PathProvider.AirlineTicketView);
            _container.RegisterType<Object, ContractView>(PathProvider.ContractView);
            _container.RegisterType<Object, ContractEdit>(PathProvider.ContractEdit);
            _container.RegisterType<Object, ClientFileList>(PathProvider.ClientFileList);
            _container.RegisterType<Object, EditOrderAdvanced>(PathProvider.EditOrderAdvanced);
            
            
            _regionManager.RequestNavigate(RegionProvider.TaskButtonRegion, PathProvider.ClientTaskButton);
            _regionManager.RequestNavigate(RegionProvider.MainRegion, PathProvider.ClientIndex);
            
        }

        #endregion
    }
}
